/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CoalitionCirclePackage;

import java.awt.Color;
import java.awt.Point;

/**
 *
 * @author Heather
 */
public class CoalitionCircleViewerCircle
{
  public Point cornerLocation;
  public Point centerLocation;
  public Color currentColor;
  public Color defaultColor;
  public int radius;
  public int coalition;
  public int population;
  public int power;

  public void highlightOpaque()
  {
    currentColor = singleGroupHighlightColor(defaultColor);
  }

  public void highlightLowAlpha()
  {
    currentColor = multiGroupHighlightColor(defaultColor);
  }

  public void setColorToDefault()
  {
    currentColor = new Color(defaultColor.getRed(),
            defaultColor.getGreen(),
            defaultColor.getBlue(),
            defaultColor.getAlpha());
  }

  public void move(Point newCorner)
  {
    cornerLocation = newCorner;
    centerLocation = new Point(cornerLocation.x + radius, cornerLocation.y + radius);
  }

  private Color singleGroupHighlightColor(Color c)
  {
    int red = c.getRed() + 50;
    int green = c.getGreen() + 50;
    int blue = c.getBlue() + 50;
    if (red > 255)
    {
      red = 255;
    }
    if (green > 255)
    {
      green = 255;
    }
    if (blue > 255)
    {
      blue = 255;
    }
    return new Color(red, green, blue, 255);
  }

  private Color multiGroupHighlightColor(Color c)
  {
    int red = c.getRed() + 50;
    int green = c.getGreen() + 50;
    int blue = c.getBlue() + 50;
    if (red > 255)
    {
      red = 255;
    }
    if (green > 255)
    {
      green = 255;
    }
    if (blue > 255)
    {
      blue = 255;
    }
    return new Color(red, green, blue, 180);
  }
}
